﻿using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;

namespace YamrSyncDemo.YammerData
{
    [DataContract]
    public class YammerFile
    {
        [BsonId]
        [DataMember(Name = "id")]
        public long ID { get; set; }

        [DataMember(Name = "url")]
        public string Url { get; set; }

        [DataMember(Name = "web_url")]
        public string WebUrl { get; set; }

        [DataMember(Name = "type")]
        public string Type { get; set; }

        [DataMember(Name = "name")]
        public string Name { get; set; }

        [DataMember(Name = "original_name")]
        public string OriginalName { get; set; }

        [DataMember(Name = "full_name")]
        public string FullName { get; set; }

        [DataMember(Name = "description")]
        public string Description { get; set; }

        [DataMember(Name = "content_type")]
        public string ContentType { get; set; }

        [DataMember(Name = "content_class")]
        public string ContentClass { get; set; }

        [DataMember(Name = "created_at")]
        public string CreatedAt { get; set; }

        [DataMember(Name = "owner_id")]
        public long OwnerID { get; set; }

        [DataMember(Name = "owner_type")]
        public string OwnerType { get; set; }

        [DataMember(Name = "official")]
        public bool Official { get; set; }

        // ...
        
        [DataMember(Name = "download_url")]
        public string DownloadUrl { get; set; }

        // ...

        [DataMember(Name = "size")]
        public long Size { get; set; }

        // ...

        [DataMember(Name = "path")]
        public string Path { get; set; }

        // ...

        [DataMember(Name = "privacy")] // public, ...
        public string Privacy { get; set; }

        [DataMember(Name = "group_id")]
        public Nullable<long> GroupID { get; set; }

        // ...
    }

    [DataContract]
    public class YammerFiles : SerializedJson<YammerFiles>
    {
        [DataMember(Name = "files")]
        public List<YammerFile> Files { get; set; }

        public YammerFiles()
        {
            this.Files = new List<YammerFile>();
        }
    }
}
